﻿

using Dapper;
using HBase;
using HBase.cache;
using hCommand;

using hCommand.dto;
using hCommand.entity;
using hCommand.mySql;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;

namespace hCommand.abs
{
    public abstract class AbsChouYangServer : AbsWMSBaseServer, IChouYangServer
    {
        public DateTime getLastEqupEndTime()
        {
            IDbConnection con = getConnection(BaseConfig.BaseDBConnStr);
            return con.QueryUnique<DateTime>("select min(use_end_time) from Cy_Equp");
        }


        public  long getEqupCode( ) {

            var p = new SqlParameter("myIndex", SqlDbType.BigInt);
            p.Direction = ParameterDirection.Output;
            runProcedure("", "Equp_id", p);
            return (long)p.Value;


        }
        public void setLastEqupEndTime(long id, DateTime t)
        {
            IDbConnection con = getConnection(BaseConfig.BaseDBConnStr);
           
            con.Execute("update Cy_Equp set use_end_time=@t ", new { t,id });

    
        }
    }
}
